import request from '@/utils/request'

export const getPageList = (_limit, _start, title_contains) => request({
  url: '/pages',
  params: {
    _limit,
    _start,
    title_contains
  }
})

export const getPageCount = title_contains => request({
  url: '/pages/count',
  params: {
    title_contains
  }
})

export const addPage = data => request({
  url: '/pages',
  method: 'post',
  data
})

export const onePage = id => request({
  url: '/pages/' + id
})

export const editPage = data => request({
  url: '/pages/' + data.id,
  method: 'put',
  data
})

export const delPage = id => request({
  url: '/pages/' + id,
  method: 'delete'
})

